package com.spring.boot.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.spring.boot.entity.TitleDate;
import com.spring.boot.response.Result;
import com.spring.boot.service.TitleDateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/tittleDate")
public class TitleDateController {

    @Autowired
    private TitleDateService titleDateService;

    @GetMapping("/get")
    public Result<?> getTittleDate(TitleDate titleDate){
        List<TitleDate> resultList = titleDateService.list(new QueryWrapper<TitleDate>().select("number","title"));
        return Result.ok(resultList);
    }
}
